package com.cooldatasoft.domain.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import com.cooldatasoft.domain.model.Project;

@SuppressWarnings("serial")
@Entity
@Table(name = "Document", catalog = "ws1259000db")
public class Document implements Serializable {

	private long id;
	private String university = "University";
	private String faculty = "Faculty";
	private String department= "Department";
	private String lecturer= "Lecturer";
	private String instructor= "Instructor";
	private String year= "1. Bc";
	private DocumentType type;
	private Project project;

	public Document() {
	}

	public Document(int id_in, String university_in, String faculty_in,
			String department_in, String lecturer_in, String instructor_in,
			String year_in, DocumentType type_in, Project project_in) {
		this.id = id_in;
		this.university = university_in;
		this.faculty = faculty_in;
		this.department = department_in;
		this.lecturer = lecturer_in;
		this.instructor = instructor_in;
		this.year = year_in;
		this.type = type_in;
		this.project = project_in;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "id_document", unique = true, nullable = false)
	public long getId() {
		return this.id;
	}

	public void setId(long id_in) {
		this.id = id_in;
	}

	@Column(name = "university", length = 250)
	public String getUniversity() {
		return this.university;
	}

	public void setUniversity(String university_in) {
		this.university = university_in;
	}

	@Column(name = "faculty", length = 100)
	public String getFaculty() {
		return faculty;
	}

	public void setFaculty(String faculty) {
		this.faculty = faculty;
	}

	@Column(name = "department", length = 100)
	public String getDepartment() {
		return department;
	}

	public void setDepartment(String department) {
		this.department = department;
	}

	@Column(name = "lecturer", length = 50)
	public String getLecturer() {
		return lecturer;
	}

	public void setLecturer(String lecturer) {
		this.lecturer = lecturer;
	}

	@Column(name = "instructor", length = 50)
	public String getInstructor() {
		return instructor;
	}

	public void setInstructor(String instructor) {
		this.instructor = instructor;
	}

	@Column(name = "year", length = 50)
	public String getYear() {
		return year;
	}

	public void setYear(String year) {
		this.year = year;
	}

	@ManyToOne
	@JoinColumn(name = "id_project", nullable = false)
	public Project getProject() {
		return this.project;
	}

	public void setProject(Project idProject) {
		this.project = idProject;
	}

	@Column(name = "type", nullable = false, insertable = true, updatable = true)
	@Enumerated(EnumType.ORDINAL)
	public DocumentType getType() {
		return this.type;
	}

	public void setType(DocumentType type_in) {
		this.type = type_in;
	}
}
